home *** CD-ROM | disk | FTP | other *** search
/ Satanic Rites 4 / Satanic Rites - Issue 4 (1993-05-29)(Destiny).adf / Use_of_wack / Use_of_wack
Text File  |  1990-01-05  |  14KB  |  329 lines

  1. }0a000
  2.          {a-+----------------+-            the ROM Kernal Manual :Exec
  3. {a         -+ {fGive it a wack{a +-
  4.   {a       -+----------------+-            So without further ado, here it is for
  5.    {a      -+ {fAn informative{a +-            those  of  you  that don't want to buy
  6.     {a     -+  {f article by   {a+-            the book ...
  7.       {a   -+   {fTerminator   {a+-
  8.         {a -+----------------+-           {g ROM-WACK{a
  9.  
  10.  
  11. I have noticed that in various places,   {eIntroduction:{a
  12. people  have  spotted strange words in
  13. ROM such as ...  Alter, set, boot etc.   Wack  is  a  keystroke-interactive bug
  14.                                          exterminator  used with Amiga hardware
  15. Then,  someone  came along and said...   and  software.   ROM-Wack  is a small,
  16. {f"{eOh  yeah,  they're used by Wack - the{a   ROM-resident  version primarily useful
  17. {edebugger in ROM{f"{a                         for     system-crash    data-structure
  18.                                          examination.     ROM-Wack's    command
  19. Well, that's true, so nothing more was   syntax   and   display   formats   are
  20. said.                                    identical to Grand-Wack of which it is
  21.                                          funtionally   a   subset.    GrandWack
  22. After a lot of searching, I managed to   includes both the ROM-resident and the
  23. find the documentation for {cROM-WACK{a in   remote versions of Wack.
  24. {eGetting to Wack{a                          calling  the  Exec  Debug()  function.
  25.                                          This  is useful during the debug phase
  26. ROM-Wack   will  be  invoked  by  Exec   of    development   for   establishing 
  27. automatically   upon  a  fatal  system   program   breakpoints.    For   future
  28. error,  or  it  be  explicity  invoked   compatability,  Debug should be called
  29. through  the  exec  Debug()  function.   with  a  single  null parameter -- for
  30. Once    invoked,    Communication   is   example,   Debug   (0).   Please  note
  31. performed  through  the RS232-C Serial   however,   that  calling  the  Debug()
  32. data port at 9600 baud.                  function  does  not necessarily invoke
  33.                                          ROM-Wack.   If  Grand-Wack  or  a user
  34. When a fatal system error occurs, Wack   supplied  debugger has been installed,
  35. can  be  used  to examine memory in an   it   will   be  invoked  in  place  of
  36. attempt  to  locate  the source of the   ROM-Wack.
  37. failure.   The  state  of  the machine
  38. will  be  frozen at the point in which   When  Wack  is  called from a program,
  39. the  error  occured  and Wack will not   system  interupts continue to process,
  40. disturb  the  state  of  system beyond   but    multitasking    is    disabled.
  41. using  a  small  amount  of supervisor   Generally  this  is not harmful to the
  42. stack,  memory between 200.w and 400.w   system.    Your  graphics  will  still
  43. hex and the serial data port             display,  keys may be typed, the mouse
  44.                                          can  be  moved,  and  so on.  However,
  45. A program may explicity invoke Wack by   many  interupts  deposit raw data into
  46. bounded  or  circular  buffers.  These   Keystrokes, numbers, and symbols
  47. ineterupts often signal related device
  48. tasks   to   further   process   these   Wack  performs  a  function upon every
  49. buffers.    If   too  many  ineterupts   keyboard   keystroke.    In  ROM-Wack,
  50. occur,  device  buffers  may  begin to   these  functions are permanently bound
  51. overflow  or  wrap around.  You should   to  certain keys.  For example, typing
  52. limit  the  number of interupt actions   ">"  will  immediately  result  in the
  53. (typing keys on the Amiga keyboard for   execution  of  the next-word function.
  54. example)  you  perform while executing   This   type   of   operation  gives  a
  55. in Wack.                                 "keystroke-interactive"  feel  to most
  56.                                          of the common Wack commands.
  57. Finally,  certain  system failures are
  58. so  serious  that the system is forced   Whenever  a  key  is  pressed,  it  is
  59. to  reboot.   Before  rebooting  takes   mapped   through   a   keymap,   which
  60. place,   the   power  LED  will  flash   translates  it  into an action.  A key
  61. slowly.   If  you type a Del character   can   have   different   meanings   in
  62. (hex  7F)  while  the LED is flashing,   different  contexts.   For simplicity,
  63. the  system  will  enter  Wack  before   ROM-Wack  applies keys consistently in
  64. rebooting.                               all  contexts  (The Grand-Wack feature
  65.                                          of   arbitrary   key  binding  is  not
  66.                                          available in ROM-Wack).                 
  67.                                          If  a  string  of keys forms a number,
  68. that    number   is   treated   as   a                                         
  69. hexadecimal  value.   If  a  string of
  70. keys  is  neither a number nor a known
  71. symbol,  the  message "unknown symbol"
  72. is presented.
  73.  
  74. During the "collection" of a symbol or
  75. number   string,  typing  a  backspace
  76. deletes    the   previous   character.
  77. Typing  <CTRL-X>  deletes  the  entire
  78. line.
  79.  
  80. Register Frame
  81.  
  82. When Wack is invoked for any reason, a
  83. register frame is displayed:
  84.  
  85. {c-------------------------------------------------------------------------------{a
  86. {fROM-Wack{a
  87.  
  88. {fPC: F00AB4  SR:0000  USP: 001268  SSP:07FFE8  TRAP:0000  TASK:0008B8
  89. DR: 00000001 00000004 0000000C 00000AB4 00000001 0000001C 00000914 00000914
  90. SR: 00000AB4 00F0D348 00011A80 00000B9C 00F20770 00F20380 00000604
  91. SF: 0000 00F0 0AB4 0014 00F0 0AB4 0014 00F0 0AB4 0004 00F0 0AB4 0000 0004 0000
  92.  
  93. {a This  frame displays the current processor state and system context from which
  94.  you  entered  Wack.   If  you are familiar with the MC68000 processor, most of
  95.  this  frame  should  be  obvious:   USP for user stack pointer, SSP for system
  96.  stack pointer e.t.c.
  97.  
  98.  The  TRAP  field  indicates the trap number the forced us into Wack.  Motorola
  99.  uses  the  term  "exceptions" for these traps.  In exec, the term exception is
  100.  used for asynchronous task events.  The standard TRAP numbers are
  101.  
  102.  {f0  {a-{e Normal entry.
  103.  {f2  {a-{e Bus Error.
  104.  {f3  {a-{e Address Error.
  105.  {f4  {a-{e Illegal Instruction.
  106.  {f5  {a-{e Zero divide.
  107.  {f6  {a-{e CHK instruction (Should not happen).
  108.  {f7  {a-{e TRAPV instruction (should not happen).
  109.  {f8  {a-{e Privilege violation.
  110.  {f9  {a-{e Trace (Single step).
  111.  {fA  {a-{e Line 1010 emulator.
  112.  {fB  {a-{e Line 1111 emulator.
  113.  {f2N {a-{e Trap instruction N (2F normally for breakpoint).
  114.  
  115. {A The TASK field indicates the task from which the system entered Wack.  If this
  116.  field is zero, the system entered Wack from supervisor mode.
  117.  
  118. {a The  SF  line  provides a backtrace of the current stack frame.  This is often
  119.  useful  for  determining  the current execution context (last function called,
  120.  for  example).   The user stack is displayed for entry from a task; the system
  121.  stack  for  entry from supervisor mode.  (Note:  Version 25.1 always shows the
  122.  system stack, never the user stack.  This will change.)
  123.  
  124.  
  125. {e Display Frames{a
  126.  
  127.  Wack displays memory in fixed size frames.  A frame may vary in size from 0 to
  128.  64K  bytes.   Frames  normally  show  addresses,  word size hex data and ASCII
  129.  equivalent characters:
  130.  
  131. {f F000C4 6578 6563 2E6C 6962 7261 7279 0000 4AFC {a  e x e c . l i b r a r y . . .
  132. {f F000D4 00F0 00D2 00F0 2918 0019 0978 00F0 00C4  {a . . . . . . )^X..^Y^I x . . .
  133.  
  134.  By  default,  Wack  will  pack  as much memory content as it can onto a single
  135.  line.   Sometimes it is preferable to see more or less than this default frame
  136.  size.   The frame size may be modified with :n Here "n" represents a number of
  137.  bytes (rounded to the next unit size) that will be displayed.
  138.  
  139. {f :4
  140.  F000C4 6578 6563   e x e c
  141.  :20
  142.  F000C4 6578 6563 2E6C 6962 7261 7279 0000 4AFC  {a e x e c . l i b r a r y . . .
  143. {f F000D4 00F0 00D2 00F0 2918 0019 0978 00F0 00C4   {a. . . . . . )^X..^Y^I x . . .
  144.  
  145.  A ":0" framesize is useful for altering write only custom chip registers
  146.  
  147.  
  148.  {eRelative Positioning{a
  149.  
  150.  Wack  functions as a memory editor; nearly all commands are performed relative
  151.  to  your  current  position  in memory.  The following commands cause relative
  152.  movement:
  153.  
  154. {c .      {g         Forward a frame
  155.  
  156. {c ,        {g       Backward a frame
  157.  
  158. {c >          {g     Forward a word
  159.  
  160. {c <            {g   Backward a word
  161.  
  162. {c +n       {g       Forward n bytes
  163.  
  164. {c -n         {g     Backward n bytes
  165.  
  166. {c <RETURN>     {g   Redisplay current frame
  167.  
  168. {c <SPACE>   {g      Foreward a word
  169.  
  170. {c <BKSP>      {g    Backward a word
  171.  
  172. {a  An example of the use of these commands is provided below;
  173.  
  174.  
  175. {c <RETURN>{a
  176. {f F00200  7072 6573 656E 7429 0D0A 0000 2028 6372  {ap r e s e n t )^M^J ...
  177.  .
  178. {f F00210  6173 6820 2D20 6361 6E6E 6F74 2072 6563  {aa s h   -   c a n n o t
  179.  ,
  180. {f F00200  7072 6573 656E 7429 0D0A 0000 2028 6372  {ap r e s e n t )^M^J ...
  181.  >
  182. {f F00202  6573 656E 7429 0D0A 0000 2028 6372 6173  {ae s e n t )^M^J ....  (
  183.  <
  184. {f F00200  7072 6573 656E 7429 0D0A 0000 2028 6372  {ap r e s e n t )^M^J ...
  185.  +24
  186. {f F00224  290D 0A00 2028 626F 6F74 2064 6576 6963  {a)^M^J..   ( b o o t  d
  187.  -38
  188. {f F001EC  6C65 290D 0A00 2028 6E6F 2064 6562 7567  {al e )^M^J..   ( n o  d
  189.  
  190.  
  191.  
  192. {e Absolute Positioning{a
  193.  
  194.  There  are  a  few  commands  that perform absolute positioning.  Typing a hex
  195.  number moves you to that position in memory:
  196.  
  197. {f 10ec
  198.  0010ec  00F0 17C0 4EF9 00F0 179A 4EF9 00F0 1786  {a....^W ..N ......^W ..
  199.  
  200.  Also,  Wack  maintains an indirection stack to help you walk down linked lists
  201.  of absolute pointers
  202.  
  203. {f 4
  204.  000004  0000 11EC 00F0 0A8E 00F0 0A90 00F0 0A92  {a....^Q......^J......^J.....
  205.  [     (Use current longword as the next address)
  206. {f 0011ec  0000 18F6 0000 1332 0900 00F0 086A 0000  {a....^X......^S 2^I.........
  207.  ]     (return to the previous "indirected" address)
  208. {f 000004  0000 11EC 00F0 0A8E 00F0 0A90 00F0 0A92  {a....^Q......^J......^J.....
  209.  
  210. {a The find command finds a given pattern in memory, and the limit command
  211.  determines the upper bound of the search. The pattern may be from one to four
  212.  bytes in length.
  213.  
  214.  The pattern is not affected by the alignment of memory; that is, byte alignment
  215.  is used for all searches regardless of the pattern size.
  216.  
  217.  To set the upper bound for a find command, type and address followed by limit
  218.  or ^  The default is 1000000 hex
  219.  
  220. {e Altering Memory{a
  221.  
  222.  The == command lets you modify your current memory word:
  223.  
  224. {f 20134
  225.  020134 0000 0000 0000 . . . . . . . . . . . . .
  226.  020134 0000 == 767
  227.  020134 0767 0000 0000 ^G  g . . . . . . . . . .
  228.  
  229. {a If the frame size is zero, the contents of the word will not be displayed prior
  230.  to your modification of that word:
  231.  
  232. {f :0
  233.  DFF09C
  234.  DFF09C xxxx == 7FFF
  235.  
  236. {a If you decide not to modify the contents after typing a ==, press <RETURN>
  237.  without typing a number. If you have already typed a number, type <CTRL-X>.
  238.  
  239. {a The alter command performs a repeated == which is handy for setting up tables.
  240.  While in this mode the > and < will move you forward or backward one word.
  241.  To exit from this mode, type a <RETURN> with no preceding number.
  242.  
  243. {f alter
  244.  001400 0280 == 222
  245.  001402 00C8 == <
  246.  001400 0222 == 333
  247.  001402 00C8 == 444
  248.  001404 0000 == 0
  249.  001406 3700 == >
  250.  001408 0000 == 666
  251.  00140A 0000 == <RETURN>
  252.  
  253. {a You can modify registers when single-stepping or breakpointing. Typing !
  254.  followed by the register name (D0-D7,A0-A6),U) lets you make modifiactions. SR
  255.  and SSP cannot be modified.
  256.  
  257. {a The fill command fills memory with a given pattern from the current location to
  258.  an upper bound. The limit command determines the upper bound of the fill. The
  259.  size of the fill pattern determines the number of bytes the pattern occupies in
  260.  memory. For example, typing
  261.  
  262. {f fill <RETURN>
  263.  45
  264.  
  265. {a fills individual vytes with 45. Typing
  266.  
  267. {f fill <RETURN>
  268.  045
  269.  
  270.  fills words, and
  271.  
  272.  fill <RETURN>
  273.  0000045
  274.  
  275.  fills longwords.
  276.  
  277. {c Caution:{a Using the fill command without properly setting the limiy can destroy
  278.  data in memory. To set the upper bound for a fill, type an address followed by
  279.  limit or a ^
  280.  
  281.  
  282.  
  283. {f Execution Control
  284.  
  285. {a These commands control program execution and system reset:
  286.  
  287. {f go       {aexecute from current address
  288.  
  289. {f resume   {aresume at current PC address
  290.  
  291. {f ^D       {aresume at current PC address
  292.  
  293. {f ^I (TAB) {aSingle instruction step
  294.  
  295. {f boot     {aReboot system (cold-reset)
  296.  
  297. {f ig       {aReboot system (cold-reset)
  298.  
  299.  
  300. {e Breakpoints{a
  301.  
  302.  ROM-Wack has the ability to perform limited program breakpoints. Up to 16
  303.  breakpoints may be set. The breakpoint commands are as follows:
  304.  
  305.  {fset {a    set breakpoint at current address
  306.  
  307.  {fclear {a  clear breakpoint at current address
  308.  
  309.  {fshow  {a  show all breakpoint addresses
  310.  
  311.  {freset  {a clear all breakpoints
  312.  
  313.  To set a breakpoint, position the address pointed to the break address and type
  314.  set. Resume program execution with go or resume. When your breakpoint has been
  315.  reached, Wack will display a register frame. The breakpoint is automatically
  316.  cleared once the breakpoint is reached.
  317.  
  318.  
  319.  
  320. {f Returning to multitasking after a crash.{a
  321.  
  322.  The user command forces the machine back into multitasking mode after a crash
  323.  that invoked ROM-Wack. This gives your system a chance to flush disk buffers
  324.  before you reset, thus securing your disks's super-structures.
  325.  
  326.  Once you type `user', you cannot exit from ROM-Wack, so you should use this
  327.  command only when you want to reboot after debugging.  Give your disk a few
  328.  seconds to write out it's buffers.  If your machine is in serious trouble,
  329.  the user command may not work.